Skip to content

Add descriptive error message for test_cpp_extensions ModuleNotFoundError#5978

Merged
ezyang merged 2 commits intopytorch:masterfrom
vedanuj:test_cpp_error_msg
Mar 26, 2018
Merged

Add descriptive error message for test_cpp_extensions ModuleNotFoundError#5978
ezyang merged 2 commits intopytorch:masterfrom
vedanuj:test_cpp_error_msg

Conversation

@vedanuj
Copy link
Copy Markdown
Contributor

@vedanuj vedanuj commented Mar 24, 2018

Addresses #5963

New error message :

[vedanuj@devgpu169.prn2 /data/users/vedanuj/pytorch] python test/test_cpp_extensions.py
'test_cpp_extensions.py' cannot be invoked directly. Run 'python run_test.py -i cpp_extensions' for the 'test_cpp_extensions.py' tests.
Traceback (most recent call last):
  File "test/test_cpp_extensions.py", line 6, in <module>
    import torch_test_cpp_extension as cpp_extension
ModuleNotFoundError: No module named 'torch_test_cpp_extension'

@ezyang Please review

Copy link
Copy Markdown
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -i flag in run tests py can be used to run only this test.

@vedanuj
Copy link
Copy Markdown
Contributor Author

vedanuj commented Mar 24, 2018

@pytorchbot retest this please

@vedanuj
Copy link
Copy Markdown
Contributor Author

vedanuj commented Mar 24, 2018

Changed the error message to

'test_cpp_extensions.py' cannot be invoked directly. Run 'python run_test.py -i cpp_extensions' for the 'test_cpp_extensions.py' tests.

@ezyang ezyang merged commit 4dc8c2a into pytorch:master Mar 26, 2018
@vedanuj vedanuj deleted the test_cpp_error_msg branch October 27, 2018 01:38
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…rror (pytorch#5978)

* Add descriptive error message for test_cpp_extensions ModuleNotFoundError error.

* Modify the error message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants