Comments (2)
This exits with code
1
:class TestBug def test_bug(self) -> None: assert True
ERROR tests/unit/server/util/garbo_test.py
This is a SyntaxError during collection, causing no tests to ever run, and pytest to exit with exit status 2. After fixing the missing :
, this is a passing test. There is no reason why it should fail.
edit: Ah, I suppose the syntax error might have been intended, and I see how you could get the output you posted. However, I don't see why this should exit with exit code 1 rather than 2. Are you actually running pytest, or some wrapper script around it?
This exits with code
0
:class TestBug: def test_bug(self) -> None: a = fake_var
ERROR tests/unit/server/util/garbo_test.py::TestBug::test_bug - NameError: name 'fake_var' is not defined
I see no reason why it should, this seems like an issue in your environment of some sort (e.g. a wrapper script around pytest).
If the SyntaxError wasn't intended, please show a complete, runnable example that actually exhibits the problem you're describing- and in any case, please show the full output of running pytest and getting the exit code on it.
from pytest.
You were right! I found a sneaky conftest
that was manipulating the reports in an incorrect way. Thanks
from pytest.
Related Issues (20)
- 8.2.1: documentation build fails HOT 3
- 8.2.1: pytest self test fails with `NameError: name 'group' is not defined` error message HOT 17
- "Collecting" hangs forever if mark.parametrize is used with scope session or module HOT 1
- pytest thread safety should be better documented HOT 5
- "AttributeError: 'NoneType' object has no attribute 'when'" error when attempting to hook `pytest_runtest_makereport` with `wrapper=True` HOT 2
- Assertions are rewritten even if a message is present HOT 2
- Link canonical documentation to discourage search engines from linking old docs HOT 1
- ASCII color chars leaking into xml report file when using verbose flag HOT 3
- Add newline after test status ouput HOT 1
- Unittest class instances no longer released on test teardown since pytest 8.2.0
- pytest.skip in conftest/__init__ files doesn't work as expected HOT 2
- Allow to dynamically create fixture in plugin HOT 11
- "Conditions as strings instead of booleans" docs act like `pytest.config` is still a thing
- `OSError: [Errno 39] Directory not empty` when doing `cache.mkdir()` from session fixture + pytest-xdist HOT 1
- `pytest_ignore_collect` documentation is misleading HOT 2
- Help Crash HOT 3
- Add hooks to allow further AST customization and control pyc caching while assertion rewriting. HOT 1
- pytest_terminal_summary question 关于运行同一个例子但是结果样式不同问题 HOT 8
- log_file Does not support formatting?For example, generate the date of the day HOT 3
- Allow the user to provide the submission command that will be prepended to the PyTest command that runs individual tests HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest.