-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improving error message when trying to import requests
- Loading branch information
1 parent
d94029b
commit c0eb262
Showing
2 changed files
with
172 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pytest | ||
|
||
import urllib3 | ||
|
||
class TestRequestImport(object): | ||
def test_request_import_warning(self): | ||
""" Ensure an appropriate error is raised to the user | ||
if they try and import urllib3.request directly """ | ||
with pytest.warns(UserWarning): | ||
urllib3.request(1, a=2) |