This file contains hidden or 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
ubuntu@web-caddy-1:/home/caddy$ ls -alih | |
total 26M | |
261382 drwxr-xr-x 4 www-data www-data 4.0K Jul 21 07:58 . | |
1613 drwxr-xr-x 4 root root 4.0K Jul 21 07:54 .. | |
261384 -rw-r--r-- 1 www-data www-data 220 Apr 4 18:30 .bash_logout | |
261385 -rw-r--r-- 1 www-data www-data 3.7K Apr 4 18:30 .bashrc | |
261383 -rw-r--r-- 1 www-data www-data 807 Apr 4 18:30 .profile | |
261430 drwxr-xr-x 2 www-data www-data 4.0K Jul 21 07:58 .ssh | |
261402 -rw-r--r-- 1 www-data 1001 22K Jul 20 14:20 CHANGES.txt | |
261403 -rw-r--r-- 1 www-data 1001 16K Jul 20 14:20 EULA.txt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
import pytest | |
def test_something(): | |
with pytest.raises(BlahException) as blah: | |
do_something_that_raises() | |
with pytest.raises(BlahException) as blah: | |
do_something_that_raises() # This fails as if it didn't raise |
This file contains hidden or 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
import pytest | |
def test_something(): | |
# Notice how the "as blah" is missing | |
with pytest.raises(BlahException): | |
do_something_that_raises() | |
with pytest.raises(BlahException): | |
do_something_that_raises() # This succeeds as if it raised. |
This file contains hidden or 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
class MonObjet: | |
blah = 1 | |
something = "something" | |
instance = MonObjet() | |
instance.blah |
This file contains hidden or 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
def dbg(result): | |
""" | |
Recover the expression giving the result, and then | |
print a helpful debug statement showing this | |
""" | |
import inspect | |
frame = inspect.stack()[1] | |
expr = extract_dbg(frame.code_context[0]) | |
filename = frame.filename.split("/")[-1] |
OlderNewer