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 ( bc5271...0254c9 )
by Michael
01:27
created

map_pool()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 3
rs 10
1
from unittest import mock
2
3
4
import pytest
5
6
from server import LadderService
7
from server.players import Player
8
9
10
@pytest.fixture()
11
def map_pool():
12
    return [(1, '', 'scmp_001'), (5, '', 'scmp_05'), (10, '', 'scmp_010'), (12, '', 'scmp_012'), (11, '', 'scmp_0011')]
13
14
def playerMock(lobbythread, id):
0 ignored issues
show
Bug Best Practice introduced by
This seems to re-define the built-in id.

It is generally discouraged to redefine built-ins as this makes code very hard to read.

Loading history...
15
    player_mock = mock.create_autospec(spec=Player(''))
16
    player_mock.login = "Player %s" % id
17
    player_mock.id = id
18
    player_mock.game_port = 4242
19
    player_mock.lobby_connection = lobbythread
20
    return player_mock
21
22
23
@pytest.fixture()
24
def player1(lobbythread):
25
    return playerMock(lobbythread, 1)
26
27
28
@pytest.fixture()
29
def player2(lobbythread):
30
    return playerMock(lobbythread, 2)
31
32
33
@pytest.fixture()
34
def ladder_setup(player1, player2, map_pool):
0 ignored issues
show
Comprehensibility Bug introduced by
map_pool is re-defining a name which is already available in the outer-scope (previously defined on line 11).

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...
Comprehensibility Bug introduced by
player1 is re-defining a name which is already available in the outer-scope (previously defined on line 24).

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...
Comprehensibility Bug introduced by
player2 is re-defining a name which is already available in the outer-scope (previously defined on line 29).

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...
35
    return {
36
        'player1': player1,
37
        'player2': player2,
38
        'map_pool': map_pool
39
    }
40
41
@pytest.fixture()
42
def ladder_service(game_service, game_stats_service):
43
    return LadderService(game_service, game_stats_service)
44