I got AttributeError: has no attribute ‘test’ when I run python unit test.
The cause of the error is due to file naming that has ‘filename.test.py’. So I change into test_filename.py then it works!
1 2 3 4 5 6 7 8 9 10 11 |
wan@Wans-MacBook-Pro-2 python % python3 -m unittest post_request.test.py E ====================================================================== ERROR: test (unittest.loader._FailedTest.test) ---------------------------------------------------------------------- AttributeError: module 'post_request' has no attribute 'test' ---------------------------------------------------------------------- Ran 1 test in 0.000s FAILED (errors=1) |