This is the code you need to align images to the left:
1. Find the stash commits:
git log --graph --oneline --decorate $( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )
This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.
Question:
What could I try for doing Test Impact Analysis for Python projects?
Answer:
There are a few libraries out there you could try. Here are some entrypoints:
python-tia
- this is my preferencepytest-tia
's docs. You can use this as a starting point to comparing alternatives.diff --git a/local.yml b/local.yml | |
index b587373..73684bf 100644 | |
--- a/local.yml | |
+++ b/local.yml | |
@@ -3,6 +3,7 @@ version: '2' | |
volumes: | |
#... | |
+ ipython_data_local: {} | |
services: |
<!-- access this at: https://cdn.rawgit.com/ErosLever/f72bc0750af4d2e75c3a/raw/owasp-risk-rating.html --> | |
<html><head> | |
<style> | |
#main{ | |
width: 1200px; | |
} | |
table { | |
width: 98%; | |
font-size: small; | |
text-align: center; |
""" Tests for `foo` package. | |
uses pytest. pytest resources: | |
* Docs: https://docs.pytest.org/en/latest/ | |
* Book! https://pragprog.com/book/bopytest/python-testing-with-pytest | |
also uses `responses`, for mocking HTTP exchanges with `requests` library: | |
* https://github.com/getsentry/responses |
#http://stackoverflow.com/questions/265960/best-way-to-strip-punctuation-from-a-string-in-python | |
import re, string | |
table = string.maketrans("","") | |
regex = re.compile('[%s]' % re.escape(string.punctuation)) | |
def test_re(s): # From Vinko's solution, with fix. | |
return regex.sub('', s) | |
def test_trans(s): |
""" throw your strings to SanitizedString and "ensure" they have been sanitized, such as removing control characters. | |
SanitizedString will avoid running redundantly, by checking type of the input (good for Very Big Strings) | |
>>> hello = SanitizedString(chr(0) + "hello") | |
>>> assert hello == "hello" | |
>>> assert chr(0) not in hello | |
>>> assert SanitizedString(hello) == hello | |
at time of writing there is only one sanitization filter in use: |
It can come up while installing anything really. I'm not sure exactly which versions of pip are affected, I know I had 1.5.6 and it was affected.
These examples are grabbed from my system level Python, but of course you should use a virtualenv.
Running setup.py install for simplegeneric
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.7/site-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
SonarQube not "uploading"? Be careful about sonar.analysis.mode=issues
(or, if using Gradle, systemProp.sonar.analysis.mode=issues
). This analysis mode seems required for some purposes (some plugins maybe?), but it was making Gradle not generate the report or upload it to SonarQube server. I haven't figured out the details yet but I wanted to leave this memo...