Skip to content

pytest /dev/null crashes #4452

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

Closed
asottile opened this issue Nov 24, 2018 · 3 comments
Closed

pytest /dev/null crashes #4452

asottile opened this issue Nov 24, 2018 · 3 comments
Labels
good first issue easy issue that is friendly to new contributor platform: linux linux platform-specific problem type: bug problem that needs to be addressed

Comments

@asottile
Copy link
Member

asottile commented Nov 24, 2018

to be fair, this might not be worth fixing -- though I was surprised to see this output:

$ pytest /dev/null
============================= test session starts ==============================
platform linux -- Python 3.6.6, pytest-4.0.1.dev42+g23e44479, py-1.7.1.dev3+gb9da2ed6, pluggy-0.8.0
rootdir: /dev, inifile:
collected 0 items / 1 errors                                                   

==================================== ERRORS ====================================
______________________________ ERROR collecting  _______________________________
venv/lib/python3.6/site-packages/_pytest/runner.py:211: in __init__
    self.result = func()
venv/lib/python3.6/site-packages/_pytest/runner.py:272: in <lambda>
    call = CallInfo(lambda: list(collector.collect()), "collect")
venv/lib/python3.6/site-packages/_pytest/main.py:495: in collect
    for x in self._collect(arg):
venv/lib/python3.6/site-packages/_pytest/main.py:571: in _collect
    assert argpath.check(file=1)
E   AssertionError
=============================== warnings summary ===============================
venv/lib/python3.6/site-packages/_pytest/cacheprovider.py:119
  /home/asottile/workspace/pygments-pytest/venv/lib/python3.6/site-packages/_pytest/cacheprovider.py:119: PytestWarning: could not create cache path /dev/.pytest_cache/v/cache/stepwise
    self.warn("could not create cache path {path}", path=path)
  /home/asottile/workspace/pygments-pytest/venv/lib/python3.6/site-packages/_pytest/cacheprovider.py:119: PytestWarning: could not create cache path /dev/.pytest_cache/v/cache/nodeids
    self.warn("could not create cache path {path}", path=path)
  /home/asottile/workspace/pygments-pytest/venv/lib/python3.6/site-packages/_pytest/cacheprovider.py:119: PytestWarning: could not create cache path /dev/.pytest_cache/v/cache/lastfailed
    self.warn("could not create cache path {path}", path=path)

-- Docs: https://docs.pytest.org/en/latest/warnings.html
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
===================== 3 warnings, 1 error in 0.15 seconds ======================
@asottile
Copy link
Member Author

I guess this wouldn't work anyway since pytest assumes a file ends with .py or it is a directory containing tests

@blueyed
Copy link
Contributor

blueyed commented Nov 24, 2018

I think this is a good corner case, i.e. it is worth fixing.

Might be just that the assertion there should be removed/changed.

@blueyed blueyed reopened this Nov 24, 2018
@Zac-HD Zac-HD added type: bug problem that needs to be addressed good first issue easy issue that is friendly to new contributor platform: linux linux platform-specific problem labels Nov 24, 2018
@asottile
Copy link
Member Author

touch t
pytest ./t

Also doesn't work so I expect this to be difficult

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue easy issue that is friendly to new contributor platform: linux linux platform-specific problem type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

3 participants