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

Natural naming warning in unit tests #346

Closed
avalentino opened this issue Mar 25, 2014 · 4 comments
Closed

Natural naming warning in unit tests #346

avalentino opened this issue Mar 25, 2014 · 4 comments
Labels
Milestone

Comments

@avalentino
Copy link
Member

.....................Exception AttributeError: AttributeError("'File' object has no attribute 
'_node_manager'",) in ................................................./home/antonio/projects
/PyTables/build/lib.linux-x86_64-3.3/tables/path.py:100: NaturalNameWarning: object 
name is not a valid Python identifier: 'test_filenode.dat'; it does not match the pattern 
``^[a-zA-Z_][a-zA-Z0-9_]*$``; you will not be able to use natural naming to access this 
object; using ``getattr()`` will still work, though
  NaturalNameWarning)
..

The problem seems to be originated in tables/nodes/tests/test_filenode.py DirectReadWriteTestCase.

See also #342.

@avalentino avalentino added this to the 3.2 milestone Mar 25, 2014
@avalentino
Copy link
Member Author

@andreas-h, @scopatz any idea on how to fix this?
Change the naming policy (e.g. filename.ext --> filename_ext) or just silence the warning?

@scopatz
Copy link
Member

scopatz commented Apr 10, 2014

Can we just change the filename? Or the group / array in the file?

@scopatz
Copy link
Member

scopatz commented Apr 10, 2014

I don't think that we should change or supress the warning.

@avalentino
Copy link
Member Author

Can we just change the filename?

Do you mean the name of the file used for the test?

Or the group / array in the file?

Probably this is the best option.
We just need a rule to translate file names into array/group names.
The original filename/path could be saved as attribute somewhere.

I don't think that we should change or supress the warning.

+1

andreas-h added a commit to andreas-h/PyTables that referenced this issue Jun 1, 2014
andreas-h added a commit to andreas-h/PyTables that referenced this issue Jun 1, 2014
alimuldal pushed a commit to alimuldal/PyTables that referenced this issue Apr 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants