Declare DEV mode in tests using conftest.py
See original GitHub issueThe terminal is set up by the fixture setup_terminal
before the DEV
flag is set manually here. What’s the point on that?
Fails on packaging for OpenSUSE because DEV mode is not enabled by default:
[ 41s] =================================== FAILURES ===================================
[ 41s] ___________________________ test_output_redirection ____________________________
[ 41s]
[ 41s] setup_terminal = <spyder_terminal.terminalplugin.TerminalPlugin object at 0x7f96cd743280>
[ 41s] qtbot_module = <pytestqt.qtbot.QtBot object at 0x7f96cd6d6fa0>
[ 41s]
[ 41s] def test_output_redirection(setup_terminal, qtbot_module):
[ 41s] """Test if stdout and stderr are redirected on DEV mode."""
[ 41s] spyder_terminal.terminalplugin.DEV = True
[ 41s]
[ 41s] stdout = osp.join(getcwd(), 'spyder_terminal_out.log')
[ 41s] stderr = osp.join(getcwd(), 'spyder_terminal_err.log')
[ 41s] > assert osp.exists(stdout) and osp.exists(stderr)
[ 41s] E AssertionError: assert (False)
[ 41s] E + where False = <function exists at 0x7f96e9e2fe50>('/home/abuild/rpmbuild/BUILD/spyder-terminal-0.3.0/spyder_terminal_out.log')
[ 41s] E + where <function exists at 0x7f96e9e2fe50> = osp.exists
[ 41s]
[ 41s] spyder_terminal/tests/test_terminal.py:189: AssertionError
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Basic patterns and examples — pytest documentation
If you have nested test directories, you can have per-directory fixture scopes by placing fixture functions in a conftest.py file in that directory....
Read more >In pytest, what is the use of conftest.py files? - Stack Overflow
conftest.py : sharing fixtures across multiple files The conftest.py file serves as a means of providing fixtures for an entire directory. ...
Read more >9 pytest tips and tricks to take your tests to the next level
To do this, store your fixtures in a file named conftest.py , either in the same folder as your tests, or in a...
Read more >7.0.0 regression: Existence of conftest.py messes up package ...
I.e., it seems that the existence of the conftest.py implies that it is no longer possible to import from tests . Imports like...
Read more >pytest Documentation - Read the Docs
Execute the test function with “quiet” reporting mode: ... into a separate conftest.py file so that tests from multiple test modules.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ok I misunderstood. I see that in this case the small test suite of spyder-terminal does not have any non DEV mode codepaths. So please disregard my comment above.
You’re totally right! Could you open a new issue or (better yet) submit a PR for that? Thanks!