I just started a Django project with Visual Studio 2019 ( v 16.4.3 ) to get familiar with it and I am seeing that the unit tests are not being discovered.
Visual Studio allows to add a unittest python file, that contains a file that should fail when run, so I am pretty sure that it should be discoverable:
import unittest
class Test_test_1(unittest.TestCase):
def test_A(self):
self.fail("Not implemented")
if __name__ == '__main__':
unittest.main()
I also tried to change the settings in Project/Properties and tried with both pytest and unittest, but the result is the same:
(of course clicking "Run All" doesn't discover anything)
Running python manage.py test
finds 0 tests as well:
Is it a known Visual Studio problem?
Or am I placing the files in the wrong path?
Any hint about what I am doing wrong here?
ps I saw another question on SO about this, but this guy was getting an error. I just get nothing at all.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.