Skip to content

Instantly share code, notes, and snippets.

================================================= test session starts =================================================
platform linux -- Python 3.9.0, pytest-6.1.1, py-1.9.0, pluggy-0.13.1
cachedir: .cache/pytest
rootdir: /home/jaraco/code/public/xonsh, configfile: setup.cfg
plugins: cov-2.10.1, timeout-1.4.2, xonsh-0.9.24
collecting ...  collecting 0 items  collecting 1015 items  collecting 3416 items / 1 skipped / 3415 selected  collecting 4076 items / 1 skipped / 4075 selected  collecting 4163 items / 1 skipped / 4162 selected  collecting 4183 items / 1 s
py27 develop-inst-noop: /Users/jaraco/code/public/foolscap
py27 installed: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support,attrs==20.2.0,Automat==20.2.0,cffi==1.14.3,constantly==15.1.0,cryptography==3.1.1,enum34==1.1.10,-e git+gh://warner/foolscap@44ce706869e2b5e633d07530ecac82514874d617#egg=foolscap,funcsigs==1.0.2,hyperlink==20.0.1,idna==2.10,incremental==17.5.0,ipaddress==1.0.23,mock==3.0.5,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycparser==2.20,pyflakes==2.2.0,PyHamcrest==1.10.1,pyOpenSSL==19.1.0,service-identity==18.1.0,six==1.15.0,Twisted==20.3.0,txtorcon==20.0.0,typing==3.7.4.3,zope.interface==5.1.2
py27 run-test-pre: PYTHONHASHSEED='3227884433'
py27 run-test: commands[0] | pyflakes setup.py src
py27 run-test: commands[1] | t
trial-retry $ cat test_sample.py
# test_sample.py
import unittest
class DemoTest(unittest.TestCase):
def test_passes(self):
pass
def test_fails(self):
self.fail("I failed.")
trial-retry $ trial test_sample.py
test_sample
$ docker run -it jaraco/multipy-tox python3 -m pip-run -q 'setuptools<48' -- -m pip-run -v --no-binary pyyaml pyyaml -- -c "import yaml; prin
t('worked!')"
Non-user install due to --prefix or --target option
Created temporary directory: /tmp/pip-target-avfqnqn_
Created temporary directory: /tmp/pip-ephem-wheel-cache-1gc9i8l7
Created temporary directory: /tmp/pip-req-tracker-s5mph4z0
Initialized build tracking at /tmp/pip-req-tracker-s5mph4z0
Created build tracker: /tmp/pip-req-tracker-s5mph4z0
Entered build tracker: /tmp/pip-req-tracker-s5mph4z0
Created temporary directory: /tmp/pip-install-6o2am2hn
distutils pypy $ git merge master
Auto-merging util.py
CONFLICT (content): Merge conflict in util.py
Auto-merging unixccompiler.py
CONFLICT (content): Merge conflict in unixccompiler.py
Auto-merging tests/test_upload.py
CONFLICT (content): Merge conflict in tests/test_upload.py
Auto-merging tests/test_spawn.py
CONFLICT (content): Merge conflict in tests/test_spawn.py
Auto-merging tests/test_msvccompiler.py
$ pip-run -q goto-http-redirect-server -- -m goto_http_redirect_server.goto_http_redirect_server --from-to / https://www.jaraco.com
2020-05-28 20:43:43 goto_http_redirect_server INFO: Serve forever at 0.0.0.0:80, Process ID 13939
2020-05-28 20:44:04 goto_http_redirect_server INFO: 127.0.0.1:64596 redirect found (/) → (https://www.jaraco.com), returning 308 (Permanent Redirect)
~ $ http -h https://www.pittsburghfreethoughtcommunity.com
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store
Connection: close
Content-Encoding: gzip
Content-Length: 12856
Content-Type: text/html; charset=utf-8
Date: Sat, 25 Apr 2020 00:56:03 GMT
Expires: -1
P3P: CP="CAO PSA OUR"
~ $ cd ~/draft
draft $ git clone gh://pypa/twine
Cloning into 'twine'...
remote: Enumerating objects: 66, done.
remote: Counting objects: 100% (66/66), done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 3549 (delta 24), reused 30 (delta 14), pack-reused 3483
Receiving objects: 100% (3549/3549), 942.33 KiB | 5.15 MiB/s, done.
Resolving deltas: 100% (2377/2377), done.
draft $ cd twine
@cherrypy.expose
def login(self, username, password):
"""
Log in the user and set a JWT web token in the cookie.
"""
res = self._login(username, password)
if not res:
raise cherrypy.HTTPError('401 Unauthorized')
self.install_token(models.Member.make_token(res))
import sys
import json
import traceback
import cherrypy
def handle_error():
"""
Handle unexpected errors (500).