question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Declare DEV mode in tests using conftest.py

See original GitHub issue

https://github.com/spyder-ide/spyder-terminal/blob/1797a86ee0f4e94627493b93440b5b99f15437a5/spyder_terminal/terminalplugin.py#L76-L80

https://github.com/spyder-ide/spyder-terminal/blob/1797a86ee0f4e94627493b93440b5b99f15437a5/spyder_terminal/tests/test_terminal.py#L183-L190

The 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:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bnavigatorcommented, Apr 5, 2020

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.

0reactions
ccordoba12commented, Apr 9, 2020

You’re totally right! Could you open a new issue or (better yet) submit a PR for that? Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found