Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Dec 7, 2019
1 parent 0d20d70 commit 4ba1b9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 16 additions & 8 deletions pytestqt/wait_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,22 @@ def __init__(self, timeout=1000, raising=True, check_params_cbs=None, order="non
super(MultiSignalBlocker, self).__init__(timeout, raising=raising)
self._order = order
self._check_params_callbacks = check_params_cbs
self._signals_emitted = [] # list of booleans, indicates whether the signal was already emitted
self._signals_map = {} # maps from a unique Signal to a list of indices where to expect signal instance emits
self._signals = [] # list of all Signals (for compatibility with _AbstractSignalBlocker)
self._signals_emitted = (
[]
) # list of booleans, indicates whether the signal was already emitted
self._signals_map = (
{}
) # maps from a unique Signal to a list of indices where to expect signal instance emits
self._signals = (
[]
) # list of all Signals (for compatibility with _AbstractSignalBlocker)
self._slots = [] # list of slot functions
self._signal_expected_index = 0 # only used when forcing order
self._strict_order_violated = False
self._actual_signal_and_args_at_violation = None
self._signal_names = {} # maps from the unique Signal to the name of the signal (as string)
self._signal_names = (
{}
) # maps from the unique Signal to the name of the signal (as string)
self.all_signals_and_args = [] # list of SignalAndArgs instances

def add_signals(self, signals):
Expand Down Expand Up @@ -422,14 +430,14 @@ def _check_signal_match(self, unique_signal, *args):
if not self._strict_order_violated:
# only do the check if the strict order has not been violated yet
self._strict_order_violated = (
True
) # assume the order has been violated this time
True # assume the order has been violated this time
)
if self._check_signal_matches_expected_index(unique_signal, *args):
self._signals_emitted[self._signal_expected_index] = True
self._signal_expected_index += 1
self._strict_order_violated = (
False
) # order has not been violated after all!
False # order has not been violated after all!
)
else:
if self._are_signal_names_available():
self._actual_signal_and_args_at_violation = SignalAndArgs(
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ passenv=DISPLAY XAUTHORITY USER USERNAME
[testenv:linting]
skip_install = True
basepython = python3.6
extras = dev
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure

[flake8]
Expand Down

0 comments on commit 4ba1b9b

Please sign in to comment.