GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 0254c9...47ea54 )
by
unknown
01:26
created

mock_players()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
from unittest import mock
2
3
import pytest
4
5
6
@pytest.fixture
7
def mock_players(mock_db_pool):
8
    from server import PlayerService
9
    m = mock.create_autospec(PlayerService(mock_db_pool))
10
    m.client_version_info = (0, None)
11
    return m
12
13
@pytest.fixture
14
def mock_games(mock_players):
0 ignored issues
show
Comprehensibility Bug introduced by
mock_players is re-defining a name which is already available in the outer-scope (previously defined on line 7).

It is generally a bad practice to shadow variables from the outer-scope. In most cases, this is done unintentionally and might lead to unexpected behavior:

param = 5

class Foo:
    def __init__(self, param):   # "param" would be flagged here
        self.param = param
Loading history...
15
    from server import GameService
16
    return mock.create_autospec(GameService(mock_players))
17
18