Skip to content

Missing example test #753

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
pytestbot opened this issue May 24, 2015 · 7 comments
Closed

Missing example test #753

pytestbot opened this issue May 24, 2015 · 7 comments
Labels
good first issue easy issue that is friendly to new contributor type: docs documentation improvement, missing or needing clarification

Comments

@pytestbot
Copy link
Contributor

Originally reported by: BitBucket: tobixx, GitHub: tobixx


http://pytest.org/latest/example/parametrize.html

#!bash

$ py.test test_time.py --collect-only 
=========================== test session starts ============================
 platform linux -- Python 3.4.1 -- py-1.4.27 -- pytest-2.7.1 
rootdir: /tmp/doc-exec-159, inifile: 

============================= in 0.00 seconds ============================= 
ERROR: file not found: test_time.py

@pytestbot
Copy link
Contributor Author

Original comment by Floris Bruynooghe (BitBucket: flub, GitHub: flub):


Oops, docs regen issue I think. Thanks for noticing.

@pytestbot
Copy link
Contributor Author

Original comment by BitBucket: tobixx, GitHub: tobixx:


Out of curiosity: where do this test files come from ?
I could not find them - even not the next successfully test_scenarios.py .

@pytestbot pytestbot added type: bug problem that needs to be addressed type: docs documentation improvement, missing or needing clarification labels Jun 15, 2015
@flub flub added task and removed type: bug problem that needs to be addressed labels Jul 24, 2015
@RonnyPfannschmidt
Copy link
Member

@tobixx any update on this?

@maartenq
Copy link

some observations:
* there seem to be different ways to re-generate the docs:
* $ make docs
* $ cd docs/en ; make regen
* $ tox -e regen
None seem to work so there is no way (for me) to reproduce the issue.
* there is 'contents of' instead of 'content of' in /doc/en/example/parametrize.txt. Changed in pull request #887
* $ make .env makes a virtualenv .env, does not clean is and .env is not in .gitignore

flub added a commit that referenced this issue Jul 25, 2015
changed contents -> content but still #753 did not solved, might be i…
@nicoddemus
Copy link
Member

I'm pretty sure this is fixed, but I'm having trouble regenerating the docs to verify as pointed by @maartenq (same error in both Windows and Linux):

Traceback (most recent call last):                                                                                                                                                                                                            
  File "/home/cabox/workspace/pytest/.env34/bin/regendoc", line 9, in <module>                                                                                                                                                                
    load_entry_point('regendoc==0.5', 'console_scripts', 'regendoc')()                                                                                                                                                                        
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/click/core.py", line 664, in __call__                                                                                                                                 
    return self.main(*args, **kwargs)                                                                                                                                                                                                         
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/click/core.py", line 644, in main                                                                                                                                     
    rv = self.invoke(ctx)                                                                                                                                                                                                                     
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/click/core.py", line 837, in invoke                                                                                                                                   
    return ctx.invoke(self.callback, **ctx.params)                                                                                                                                                                                            
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/click/core.py", line 464, in invoke                                                                                                                                   
    return callback(*args, **kwargs)                                                                                                                                                                                                          
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/regendoc/__init__.py", line 121, in main                                                                                                                              
    verbose=verbose,                                                                                                                                                                                                                          
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/regendoc/__init__.py", line 31, in check_file                                                                                                                         
    verbose=verbose)                                                                                                                                                                                                                          
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/site-packages/regendoc/actions.py", line 32, in shell                                                                                                                               
    shutil.copytree(src, targetdir)                                                                                                                                                                                                           
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/shutil.py", line 302, in copytree                                                                                                                                                   
    os.makedirs(dst)                                                                                                                                                                                                                          
  File "/home/cabox/workspace/pytest/.env34/lib/python3.4/os.py", line 237, in makedirs                                                                                                                                                       
    mkdir(name, mode)                                                                                                                                                                                                                         
FileExistsError: [Errno 17] File exists: '/tmp/regendoc-exec-bpj2afbn/nonpython.txt-75/nonpython' 

I obtain a similar error even if I try to regenerate only example/parametrize.txt:

$ regendoc --update example\parametrize.txt
#[  1/  1] example\parametrize.txt
Traceback (most recent call last):
  File "D:\Programming\Python34\Lib\runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\Programming\Python34\Lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "X:\pytest\.env34\Scripts\regendoc.exe\__main__.py", line 9, in <module>
  File "X:\pytest\.env34\lib\site-packages\click\core.py", line 664, in __call__
    return self.main(*args, **kwargs)
  File "X:\pytest\.env34\lib\site-packages\click\core.py", line 644, in main
    rv = self.invoke(ctx)
  File "X:\pytest\.env34\lib\site-packages\click\core.py", line 837, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "X:\pytest\.env34\lib\site-packages\click\core.py", line 464, in invoke
    return callback(*args, **kwargs)
  File "X:\pytest\.env34\lib\site-packages\regendoc\__init__.py", line 121, in main
    verbose=verbose,
  File "X:\pytest\.env34\lib\site-packages\regendoc\__init__.py", line 31, in check_file
    verbose=verbose)
  File "X:\pytest\.env34\lib\site-packages\regendoc\actions.py", line 32, in shell
    shutil.copytree(src, targetdir)
  File "X:\pytest\.env34\lib\shutil.py", line 303, in copytree
    os.makedirs(dst)
  File "X:\pytest\.env34\lib\os.py", line 237, in makedirs
    mkdir(name, mode)
FileExistsError: [WinError 183] Não é possível criar um arquivo já existente: 'C:\\Users\\Bruno\\AppData\\Local\\Temp\\regendoc-exec-sp0gmhvf\\parametrize.txt-1\\.'

@russel
Copy link
Contributor

russel commented Sep 21, 2015

The reason for the FileExistsError in the case of nonpython is that, for some reason, the shell function in the actions module of regendoc is being called twice or more. Patching this function allows for a completion of "make regen", but does not explain why multiple calls are being made.

@nicoddemus
Copy link
Member

Already fixed on features

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 type: docs documentation improvement, missing or needing clarification
Projects
None yet
Development

No branches or pull requests

6 participants