Skip to content

Commit a26b0fb

Browse files
cmc333333agjohnson
authored andcommitted
Linting fixes for rtd_test module. (readthedocs#2889)
1 parent b9f15d9 commit a26b0fb

File tree

6 files changed

+11
-7
lines changed

6 files changed

+11
-7
lines changed

prospector-more.yml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ignore-paths:
1313
- projects/
1414
- redirects/
1515
- restapi/
16-
- rtd_tests/
1716
- search/
1817

1918
pylint:

readthedocs/rtd_tests/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Base classes and mixins for unit tests."""
12
import os
23
import shutil
34
import logging
@@ -18,7 +19,7 @@ def setUp(self):
1819
self.original_DOCROOT = settings.DOCROOT
1920
self.cwd = os.path.dirname(__file__)
2021
self.build_dir = os.path.join(self.cwd, 'builds')
21-
log.info("build dir: %s" % self.build_dir)
22+
log.info("build dir: %s", self.build_dir)
2223
if not os.path.exists(self.build_dir):
2324
os.makedirs(self.build_dir)
2425
settings.DOCROOT = self.build_dir

readthedocs/rtd_tests/mocks/environment.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
# pylint: disable=missing-docstring
12
import mock
23

3-
from readthedocs.doc_builder.environments import BuildEnvironment
4-
54

65
class EnvironmentMockGroup(object):
76

readthedocs/rtd_tests/mocks/mock_api.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Mock versions of many API-related classes."""
12
from contextlib import contextmanager
23
import json
34
import mock
@@ -14,6 +15,7 @@ def put(self, x=None):
1415

1516

1617
def mock_version(repo):
18+
"""Construct and return a class implementing the Version interface."""
1719
class MockVersion(object):
1820
def __init__(self, x=None):
1921
pass
@@ -22,6 +24,7 @@ def put(self, x=None):
2224
return x
2325

2426
def get(self, **kwargs):
27+
"""Returns mock data to emulate real Version objects."""
2528
# SCIENTIST DOG
2629
version = json.loads("""
2730
{
@@ -76,13 +79,13 @@ class MockApi(object):
7679
def __init__(self, repo):
7780
self.version = mock_version(repo)
7881

79-
def project(self, x):
82+
def project(self, _):
8083
return ProjectData()
8184

82-
def build(self, x):
85+
def build(self, _):
8386
return mock.Mock(**{'get.return_value': {'id': 123, 'state': 'triggered'}})
8487

85-
def command(self, x):
88+
def command(self, _):
8689
return mock.Mock(**{'get.return_value': {}})
8790

8891

readthedocs/rtd_tests/mocks/paths.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Context managers to patch os.path.exists calls."""
12
import os
23
import re
34
import mock

readthedocs/rtd_tests/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Utility functions for use in tests."""
12
import logging
23
from os import chdir, environ, getcwd
34
from os.path import abspath, join as pjoin

0 commit comments

Comments
 (0)