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.

Not sure how to run Python tests

See original GitHub issue

I tried the following on a newly generated project:

pip install -e ".[test, examples]"
py.test

But got this error:

ERROR: usage: py.test [options] [file_or_dir] [file_or_dir] [...]
py.test: error: unrecognized arguments: --nbval --current-env

I’m fairly new to the wider Python ecosystem so I may just not understand how pytest or whatever is used here is supposed to work?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
wlievenscommented, Apr 29, 2020

BTW I found why the notebooks were getting executed: the cookiecutter includes the nbval library which does exactly that.

https://pypi.org/project/nbval/

0reactions
wlievenscommented, Apr 29, 2020

Thanks, maybe it is and maybe I can ditch the shitty pipenv system if this is better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running and Writing Tests - Python Developer's Guide
Running : The shortest, simplest way of running the test suite is the following command from the root directory of your checkout (after...
Read more >
How do I run all Python unit tests in a directory? - Stack Overflow
The names of all test files and test methods should start with "test_". Otherwise the command "Run as -> Python unit test" wont...
Read more >
Run Python tests | IntelliJ IDEA Documentation - JetBrains
Run all Python tests in a directory. In the Project tool window, select the directory that contains tests to be executed.
Read more >
Unit Testing with Python unittest Module - Geekflare
The command to run the tests using the discover method is python -m unittest discover . The command will detect all the files...
Read more >
Python Tutorial: How to run Unit Test | Part 1 | Step by Step
0:00 - Intro to Unit Tests in Python ; 1:34 - Print Statement is not very good ; 2:10 - Step 1. Create...
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