Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

53: Unexpected response to "coverage run -m pytest" #329

Closed
LABranagan opened this issue Jul 31, 2020 · 5 comments · Fixed by feldroy/django-crash-starter#156
Closed

53: Unexpected response to "coverage run -m pytest" #329

LABranagan opened this issue Jul 31, 2020 · 5 comments · Fixed by feldroy/django-crash-starter#156

Comments

@LABranagan
Copy link

Greetings!

Hello! As a reader, you're encouraged to submit bug reports to us for errors that you find. In turn we will give you credit for your contributions in not just the e-book but also in the print paperback and online publicly on the web. This is your opportunity to have your name in one of our books as a contributor, which you are then welcome to add to your resume and LinkedIn profile. (Note: TODOs are markers to let you know we are going to expand an area, so reporting them during the ALPHA and BETA period doesn't qualify as an attributable item.)

Location within the Book

  • Book build date (Is the date on page 1):
  • Book format (PDF, Epub or Mobi):
  • Chapter or Appendix:
  • Section:
  • Subsection:

Hint: Page numbers change all the time. The best way to report an issue is by chapter, section, and subsection numbers.

Description

If grammar, enter problematic text here, otherwise delete this line.

If code-related, enter it within these backticks. Otherwise, delete this segment.

Possible Solutions

Your full name so we can provide accurate credit within the book

@LABranagan
Copy link
Author

Sorry, error on when to His submit button.
In Chap 53, I ran the tests for test_good_cheese_list_view_expanded(rf): and then for test_good_cheese_list_view(rf): using a cut/paste on the code provided. After pasting each method, I ran "coverage run -m pytest". Each time, all 12 (then 13) Results indicated "passed", but then a line was added:
Can't add file tracer data for unmeasured file 'C:\Users\lyleb\OneDrive\WebDev\everycheese\everycheese\templates\cheeses\cheese_list.html'
I have not been able to find any useful resources on this error from an Internet search.

I am running under PyCharm; is this an attempt to use a VS feature?

@luzfcb
Copy link
Contributor

luzfcb commented Jul 31, 2020

@LABranagan Thanks for opening a issue.

1 - Based on the little information you provided, this looks like a known bug in coverage library, that still doesn't have a definitive fix nedbat/coveragepy#1011

Could you please send the text with all the error traceback, including the command "coverage run -m pytest"

2 - Can you please run conda activate everycheese, and then run the command pip freeze and send the output.

3 - I realized that you did not fill in the information requested in the standard text that shows when create a new issue. Can you please provide them by editing the message

image

Tip: use the example below to send the traceback


```bash

# your code here

```

@LABranagan
Copy link
Author

Thank you for the quick response.

I have made the runs as suggested.

no tracer data 0720.txt

I can continue learning from the course in spite of this minor error. But, a solution, or suspected cause, might be helpful to future learners.

Lyle

@jpizzle34
Copy link

I can reproduce this too if it helps...

❯ coverage run -m pytest
Test session starts (platform: darwin, Python 3.8.3, pytest 5.4.2, pytest-sugar 0.9.3)
django: settings: config.settings.test (from option)
rootdir: /Volumes/Queequeg/PROJECTS/everycheese, inifile: pytest.ini
plugins: Faker-4.1.1, django-3.9.0, django-test-plus-1.4.0, sugar-0.9.3
collecting ... 
 everycheese/cheeses/tests/test_models.py ✓✓                                                                  11% █▎        
 everycheese/cheeses/tests/test_views.py ✓✓✓✓✓✓✓                                                              50% █████     
 everycheese/users/tests/test_forms.py ✓                                                                      56% █████▋    
 everycheese/users/tests/test_models.py ✓                                                                     61% ██████▎   
 everycheese/users/tests/test_urls.py ✓✓✓                                                                     78% ███████▊  
 everycheese/users/tests/test_views.py ✓✓✓✓                                                                  100% ██████████
===================================================== warnings summary =====================================================
everycheese/cheeses/tests/test_views.py::test_good_cheese_create_view
everycheese/cheeses/tests/test_views.py::test_cheese_create_form_valid
  /Users/user/opt/anaconda3/envs/everycheese/lib/python3.8/site-packages/whitenoise/base.py:115: UserWarning: No directory at: /Volumes/Queequeg/PROJECTS/everycheese/staticfiles/
    warnings.warn(u"No directory at: {}".format(root))

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Results (1.65s):
      18 passed
Can't add file tracer data for unmeasured file '/Volumes/Queequeg/PROJECTS/everycheese/everycheese/templates/cheeses/cheese_list.html'
❯ pip freeze
appdirs==1.4.4
appnope==0.1.0
argon2-cffi==20.1.0
arrow @ file:///Users/runner/miniforge3/conda-bld/arrow_1588902988241/work
asgiref==3.2.10
astroid==2.4.2
attrs==19.3.0
autopep8==1.5.3
backcall==0.2.0
binaryornot==0.4.4
black==19.10b0
brotlipy==0.7.0
certifi==2020.6.20
cffi==1.14.0
cfgv==3.1.0
chardet==3.0.4
click==7.1.2
cookiecutter==1.7.2
coverage==5.1
cryptography==2.9.2
decorator==4.4.2
defusedxml==0.6.0
distlib==0.3.1
Django==3.0.7
django-allauth==0.42.0
django-autoslug==1.9.7
django-countries==6.1.2
django-coverage-plugin==1.8.0
django-crispy-forms==1.9.1
django-debug-toolbar==2.2
django-environ==0.4.5
django-extensions==2.2.9
django-model-utils==4.0.0
django-stubs==1.5.0
django-test-plus==1.4.0
factory-boy==2.12.0
Faker==4.1.1
filelock==3.0.12
flake8==3.8.2
identify==1.4.19
idna==2.9
ipdb==0.13.2
ipython==7.15.0
ipython-genutils==0.2.0
isort==4.3.21
jedi==0.17.0
Jinja2==2.11.2
jinja2-time==0.2.0
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
mccabe==0.6.1
more-itertools==8.4.0
mypy==0.770
mypy-extensions==0.4.3
nodeenv==1.4.0
oauthlib==3.1.0
packaging==20.4
parso==0.7.0
pathspec==0.8.0
pexpect==4.8.0
pickleshare==0.7.5
Pillow==7.1.2
pluggy==0.13.1
poyo==0.5.0
pre-commit==2.4.0
prompt-toolkit==3.0.5
psycopg2-binary==2.8.5
ptyprocess==0.6.0
py==1.8.2
pycodestyle==2.6.0
pycparser==2.20
pyflakes==2.2.0
Pygments==2.6.1
pylint==2.5.3
pylint-django==2.0.15
pylint-plugin-utils==0.6
pyOpenSSL==19.1.0
pyparsing==2.4.7
PySocks==1.7.1
pytest==5.4.2
pytest-django==3.9.0
pytest-sugar==0.9.3
python-dateutil==2.8.1
python-slugify==4.0.0
python3-openid==3.1.0
pytz==2020.1
PyYAML==5.3.1
regex==2020.6.8
requests @ file:///home/conda/feedstock_root/build_artifacts/requests_1592425495151/work
requests-oauthlib==1.3.0
six==1.15.0
sqlparse==0.3.1
termcolor==1.1.0
text-unidecode==1.3
toml==0.10.1
traitlets==4.3.3
typed-ast==1.4.1
typing-extensions==3.7.4.2
Unidecode==1.1.1
urllib3==1.25.9
virtualenv==20.0.27
virtualenv-clone==0.5.4
wcwidth==0.2.4
Werkzeug==1.0.1
whichcraft==0.6.1
whitenoise==5.1.0
wrapt==1.12.1

@pydanny
Copy link
Member

pydanny commented Sep 15, 2020

To fix this, in settings/test.py, at the very bottom of the file, add this new line of code:

TEMPLATES[-1]["OPTIONS"]["debug"] = True 

Marking this as Done Pending Update. Please let me know if this does not work.

@pydanny pydanny closed this as completed Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants