question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to found unittest in hello-stackoverflow folder.

See original GitHub issue

Environment data

Build of Visual Studio Code - Insiders: 1.45.0-insider Build of python-insider: 2020.5.74187-dev

Repro steps

  1. Git clone https://github.com/qubitron/pydemo
  2. Open Anaconda Prompt window
  3. Cd pydemo
  4. Run py -3 setup.py
  5. Open hello-stackoverflow folder
  6. Press “Ctrl+Shift+p” to select “Run All Tests”
  7. Make sure a prompt is popup
  8. Click “Enable and configure a Test Framework”
  9. From the menus select “Unittest framework->Tests folder->Test_*.py” file

Expected behaviour

The unittest should be found successfully.

Actual behaviour

No test discovered error message pops up. image

Others

I try to create a new folder and add an new test,py. Input some code:

import unittest
class PassingTests(unittest.TestCase):
    def test_passing(self):
        self.assertEqual(42, 42)
    def test_passing_still(self):
        self.assertEqual("silly walk", "silly walk")
class FailingTests(unittest.TestCase):
    def test_failure(self):
        self.assertEqual(42, -13)
    def test_failure_still(self):
        self.assertEqual("I'm right!", "no, I am!")

It can find unittest successfully. image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kimadelinecommented, Apr 22, 2020

Hi @mdevin0,

Here’s the gif counterpart to @fcakyon explanation:

version

Yes, 2020.3.71113 is the latest stable version at the moment. No estimate for now, we’re on it 👷‍♀️

1reaction
mdevinocommented, Apr 22, 2020

Hey, thank you very much for your help! @kimadeline @fcakyon

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Unittest: Fail due to import from same folder
Notice that I'm running the command from a directory where from src.xxx ... which should execute the main function found in src.file1 ....
Read more >
Get started with unit testing - Visual Studio (Windows)
Create unit tests; Run unit tests; View live unit test results (Visual ... In the new project dialog box, find the unit test...
Read more >
unittest | Python in Visual Studio Code
This section outlines the details necessary to get you up and started with using the python unittest testing framework with Visual Studio Code....
Read more >
matlab.unittest.fixtures.TemporaryFolderFixture class
Create Temporary Folder Fixture Persisting Through Test Failure. Create the following anotherTempFolderFixtureTest class definition on your MATLAB path. For the ...
Read more >
Python Tutorial: Unit Testing Your Code with the unittest Module
In this Python Programming Tutorial, we will be learning how to unit-test our code using the unittest module. Unit testing will allow you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found