Created
July 3, 2019 06:16
-
-
Save shangxiao/35686b9aec169a8e20c042cc53ddba68 to your computer and use it in GitHub Desktop.
Pytest not raising import exceptions for regular classes?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shangxiao ~/projects/test-pytest $ pytest | |
========================================================= test session starts ========================================================= | |
platform darwin -- Python 3.6.2, pytest-5.0.0, py-1.8.0, pluggy-0.12.0 | |
rootdir: /Users/shangxiao/projects/test-pytest | |
collected 1 item | |
test_foo.py F [100%] | |
============================================================== FAILURES =============================================================== | |
________________________________________________________ FooTestCase.test_foo _________________________________________________________ | |
self = <test_foo.FooTestCase testMethod=test_foo> | |
def test_foo(self): | |
> foo = Foo() | |
E NameError: name 'Foo' is not defined | |
test_foo.py:6: NameError | |
====================================================== 1 failed in 0.04 seconds ======================================================= | |
shangxiao ~/projects/test-pytest $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BarTestCase: | |
def test_bar(self): | |
bar = Bar() | |
assert True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
class FooTestCase(TestCase): | |
def test_foo(self): | |
foo = Foo() | |
assert True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment