Skip to content

Commit fe0ecb0

Browse files
author
Leah Jones
committed
Resolves some bad rename issues with pytest.fixture
1 parent 09bf365 commit fe0ecb0

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

_pytest/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ def server(monkeypatch):
2626

2727

2828
@pytest.fixture
29-
def slackclient(client_server):
29+
def slackclient(server):
3030
my_slackclient = SlackClient('xoxp-1234123412341234-12341234-1234')
3131
return my_slackclient
3232

3333

3434
@pytest.fixture
35-
def channel(channel_server):
36-
my_channel = Channel(channel_server, "somechannel", "C12341234", ["user"])
35+
def channel(server):
36+
my_channel = Channel(server, "somechannel", "C12341234", ["user"])
3737
return my_channel
3838

_pytest/test_server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
@pytest.fixture
9-
def login_data():
9+
def login_fixture():
1010
file_login_data = open('_pytest/data/rtm.start.json', 'r').read()
1111
json_login_data = json.loads(file_login_data)
1212
return json_login_data
@@ -16,13 +16,13 @@ def test_Server(server):
1616
assert type(server) == Server
1717

1818

19-
def test_Server_parse_channel_data(server, user_login_data):
20-
server.parse_channel_data(user_login_data["channels"])
19+
def test_Server_parse_channel_data(server, login_fixture):
20+
server.parse_channel_data(login_fixture["channels"])
2121
assert type(server.channels.find('general')) == Channel
2222

2323

24-
def test_Server_parse_user_data(server, user_login_data):
25-
server.parse_user_data(user_login_data["users"])
24+
def test_Server_parse_user_data(server, login_fixture):
25+
server.parse_user_data(login_fixture["users"])
2626
assert type(server.users.find('fakeuser')) == User
2727

2828

_pytest/test_slackclient.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66

77
@pytest.fixture
8-
def channel_created():
8+
def channel_created_fixture():
99
file_channel_created_data = open('_pytest/data/channel.created.json', 'r').read()
1010
json_channel_created_data = json.loads(file_channel_created_data)
1111
return json_channel_created_data
1212

1313

1414
@pytest.fixture
15-
def im_created():
15+
def im_created_fixture():
1616
file_channel_created_data = open('_pytest/data/im.created.json', 'r').read()
1717
json_channel_created_data = json.loads(file_channel_created_data)
1818
return json_channel_created_data
@@ -22,9 +22,9 @@ def test_SlackClient(slackclient):
2222
assert type(slackclient) == SlackClient
2323

2424

25-
def test_SlackClient_process_changes(slackclient, channel_created_data, im_created_data):
26-
slackclient.process_changes(channel_created_data)
25+
def test_SlackClient_process_changes(slackclient, channel_created_fixture, im_created_fixture):
26+
slackclient.process_changes(channel_created_fixture)
2727
assert type(slackclient.server.channels.find('fun')) == Channel
28-
slackclient.process_changes(im_created_data)
28+
slackclient.process_changes(im_created_fixture)
2929
assert type(slackclient.server.channels.find('U123BL234')) == Channel
3030

slackclient/_slackrequest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
class SlackRequest(object):
55

66
@staticmethod
7-
def do(self, token, request="?", post_data=None, domain="slack.com"):
7+
def do(token, request="?", post_data=None, domain="slack.com"):
88
if post_data is None:
99
post_data = {}
1010

0 commit comments

Comments
 (0)