Lint repo.
This commit is contained in:
parent
87e762bda2
commit
44f4a0aaa8
8 changed files with 15 additions and 14 deletions
|
@ -1,9 +1,8 @@
|
|||
from damm import Damm
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize('num', [
|
||||
@pytest.mark.parametrize("num", [
|
||||
"0", # 0 itself is the start Damm state
|
||||
"37", # [0, 3] => 7
|
||||
"92", # [0, 9] => 2
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
from damm import Damm
|
||||
|
||||
from hypothesis import given
|
||||
from hypothesis.strategies import integers
|
||||
|
||||
|
|
|
@ -31,8 +31,9 @@
|
|||
|
||||
import ast
|
||||
import logging
|
||||
import sys
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
if sys.version_info < (3, 0, 0):
|
||||
builtins = __builtins__
|
||||
|
@ -115,7 +116,6 @@ class TargetNonlocalFlow(Exception):
|
|||
"""Base exception class to simulate non-local control flow transfers in
|
||||
a target application."""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class TargetBreak(TargetNonlocalFlow):
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from __future__ import print_function
|
||||
|
||||
|
||||
class Foo(object):
|
||||
def bar(self):
|
||||
return 1
|
||||
|
@ -17,6 +18,8 @@ print(a.bar())
|
|||
print(a.baz)
|
||||
|
||||
import random
|
||||
|
||||
|
||||
for _ in range(10):
|
||||
print(random.randint(0, 1024))
|
||||
|
||||
|
@ -25,4 +28,6 @@ def bar(a, b, **bs):
|
|||
pass
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
print(len(requests.get("https://pypi.org/pypi/requests/json").text))
|
||||
|
|
|
@ -121,7 +121,7 @@ class Proquint(object):
|
|||
|
||||
res = 0
|
||||
|
||||
for i, c in enumerate([c for c in buffer if c != '-']):
|
||||
for i, c in enumerate([c for c in buffer if c != "-"]):
|
||||
if (mag := cls._consonant_to_uint(c)) is not None:
|
||||
res <<= 4
|
||||
res += mag
|
||||
|
@ -131,7 +131,7 @@ class Proquint(object):
|
|||
res <<= 2
|
||||
res += mag
|
||||
elif i != 5:
|
||||
raise ValueError('Bad proquint format')
|
||||
raise ValueError("Bad proquint format")
|
||||
return res
|
||||
|
||||
# Handy aliases
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
"""Tests based off of known examples."""
|
||||
|
||||
import proquint
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
|
@ -45,12 +44,12 @@ examples = [
|
|||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize('val,width,qint', examples)
|
||||
@pytest.mark.parametrize("val,width,qint", examples)
|
||||
def test_decode_examples(val, width, qint):
|
||||
assert proquint.Proquint.decode(qint) == val, f"qint {qint} did not decode"
|
||||
|
||||
|
||||
@pytest.mark.parametrize('val,width,qint', examples)
|
||||
@pytest.mark.parametrize("val,width,qint", examples)
|
||||
def test_encode_examples(val, width, qint):
|
||||
encoded_qint = proquint.Proquint.encode(val, width)
|
||||
decoded_val = proquint.Proquint.decode(encoded_qint)
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
"""Tests based off of round-tripping randomly generated examples."""
|
||||
|
||||
import proquint
|
||||
|
||||
import pytest
|
||||
from hypothesis import given
|
||||
from hypothesis.strategies import integers
|
||||
import proquint
|
||||
import pytest
|
||||
|
||||
|
||||
@given(integers(min_value=0, max_value=1<<16))
|
||||
|
|
|
@ -104,7 +104,7 @@ def deps(requirements):
|
|||
|
||||
|
||||
@cli.command()
|
||||
@click.option("--no-upgrade/--upgrade", name="upgrade", default=False)
|
||||
@click.option("--no-upgrade/--upgrade", "", "upgrade", default=False)
|
||||
@click.argument("requirements")
|
||||
def install(requirements, upgrade):
|
||||
"""Install (or upgrade) a dependency.
|
||||
|
|
Loading…
Reference in a new issue