Add 'how to run a specific test' to the docs
See original GitHub issueSupposedly this runs a specific test:
import ipytest
ipytest.autoconfig()
def test1():
assert 2*2 == 5
ipytest.config(defopts=False)
ipytest.run('{MODULE}::test1')
(btw, is there any way to pass defopts to run directly?)
and this runs a subset of tests with a certain substring in the name:
import ipytest
ipytest.autoconfig()
def test_this1():
assert 2*2 == 11
def test_this2():
assert 2*2 == 12
def test_that1():
assert 2*2 == 21
def test_that2():
assert 2*2 == 22
ipytest.run('-k', 'this')
It was not obvious to figure it out 😃
I would suggest adding it to the docs.
Issue Analytics
- State:
- Created a year ago
- Comments:18 (10 by maintainers)
Top Results From Across the Web
How do I run a single test using Jest? - Stack Overflow
Another way is to run tests in watch mode, jest --watch , and then press P to filter the tests by typing the...
Read more >Writing and Running Tests - Dune documentation
If you would only like to run a single test for your project, you may use dune exec to run the test executable...
Read more >Maven Surefire Plugin – Running a Single Test
During development, you may run a single test class repeatedly. To run this through Maven, set the test property to a specific test...
Read more >Run tests | IntelliJ IDEA Documentation - JetBrains
To run all tests in a folder, select this folder in the Project tool window and press Ctrl+Shift+F10 or select Run Tests in...
Read more >Run Tests | Basic Guides | Guides | Docs - TestCafe
There are two ways to launch TestCafe tests. The simplest option is to use the testcafe shell command. Alternatively, you can launch tests...
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 FreeTop 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
Top GitHub Comments
Damn. Every time I think, but surely now I have seen all there is to see for IPython, there so something new. I was completely unware, that there are these hooks (for future ref: the docs). Thanks for making me aware. That would indeed be an option.
Hey @axil,
Thanks for these suggestions. You’re right the pytest command line arguments are definitely not obvious. Maybe something for a “tips and tricks” section with pointer into the pytest docs (my favs are “-x --pdb” or “–ff”).
Re giving the options directly: at the moment it is not possible, but I like it. Maybe having some way to specify them also via the magics would be cool. This way there is feature parity between the two ways of using ipytest.