https://docs.pytest.org/en/latest/usage.html
pytest
pytest path/to/tests/
pytest path/to/tests/test_file.py
pytest path/to/tests/test_file.py::test_func
pytest path/to/tests/test_file.py::TestClass
https://docs.pytest.org/en/latest/usage.html
pytest
pytest path/to/tests/
pytest path/to/tests/test_file.py
pytest path/to/tests/test_file.py::test_func
pytest path/to/tests/test_file.py::TestClass
from bokeh.io import push_notebook, output_notebook, show, save | |
from bokeh.layouts import row, column, layout | |
from bokeh.plotting import figure | |
output_notebook() |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branch pr/4
from the github upstream
(if it exists) or origin
remote and checks it outgit pr 4 someremote
- creates local branch pr/4
from someremote
remote and checks it outimport pickle | |
from autoscript_sdb_microscope_client import SdbMicroscopeClient | |
from autoscript_sdb_microscope_client.enumerations import * | |
from autoscript_sdb_microscope_client.structures import * | |
microscope = SdbMicroscopeClient() | |
microscope.connect() | |
object_to_pickle = microscope.imaging.get_image() |
# pip install code directly from github with: | |
pip install git+https://github.com/path/to/repo | |
pip install git+https://github.com/path/to/repo.git | |
# Note: the repository must include setup.py file to be pip installable. | |
# You can specify a specific repository branch with: | |
pip install git+https://github.com/path/to/repo@branchname | |
pip install git+https://github.com/path/to/repo.git@branchname |
response_yes = ['yes', 'y'] | |
response_no = ['no', 'n'] | |
response_cancel = ['quit', 'q', 'exit', 'cancel'] | |
known_responses = response_yes + response_no + response_cancel | |
user_response = '' | |
while user_response.lower() not in known_responses: | |
user_response = input("Please input a value, or enter 'quit': ") | |
print(user_response) |
[pytest] | |
addopts = --cov-report xml:cov.xml --cov-report term-missing --cov=mypackagename |
{ | |
"editor.rulers": [ | |
80 | |
], | |
"autoDocstring.docstringFormat": "numpy", | |
"python.linting.pylintEnabled": false, | |
"python.linting.flake8Enabled": true, | |
"window.zoomLevel": 0, | |
"python.formatting.provider": "autopep8", | |
"editor.formatOnSave": true, |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |