Skip to content

Commit

Permalink
feat: fixed nox file conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
vi3k6i5 committed Apr 22, 2021
2 parents a816ab9 + 00e2ee8 commit bf84e88
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 75 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -24,3 +24,6 @@ django_tests_dir

# Built documentation
docs/_build

# django tests directory
django_tests_dir/
6 changes: 3 additions & 3 deletions docs/conf.py
Expand Up @@ -18,6 +18,8 @@

import sys
import os

from version import __version__
import shlex

# If extensions (or modules to document with autodoc) are in another directory,
Expand All @@ -29,8 +31,6 @@
# See also: https://github.com/docascode/sphinx-docfx-yaml/issues/85
sys.path.insert(0, os.path.abspath("."))

__version__ = ""

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -352,7 +352,7 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable/", None),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
Expand Down
19 changes: 3 additions & 16 deletions noxfile.py
Expand Up @@ -79,7 +79,7 @@ def default(session):
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=25",
"--cov-fail-under=20",
os.path.join("tests", "unit"),
*session.posargs
)
Expand All @@ -91,19 +91,6 @@ def unit(session):
default(session)


@nox.session(python=DEFAULT_PYTHON_VERSION)
def cover(session):
"""Run the final coverage report.
This outputs the coverage report aggregating coverage from the unit
test runs (not system test runs), and then erases coverage data.
"""
session.install("coverage", "pytest-cov")
session.run("coverage", "report", "--show-missing", "--fail-under=20")

session.run("coverage", "erase")


@nox.session(python=DEFAULT_PYTHON_VERSION)
def docs(session):
"""Build the docs for this library."""
Expand Down Expand Up @@ -131,12 +118,12 @@ def docs(session):
def docfx(session):
"""Build the docfx yaml files for this library."""

session.install("-e", ".")
session.install("-e", ".[tracing]")
session.install(
"sphinx",
"alabaster",
"recommonmark",
"sphinx-docfx-yaml",
"gcp-sphinx-docfx-yaml",
"django==2.2",
)

Expand Down
15 changes: 3 additions & 12 deletions tests/unit/django_spanner/test_base.py
Expand Up @@ -13,9 +13,7 @@


@mock_import()
@unittest.skipIf(
sys.version_info < (3, 6), reason="Skipping Python versions <= 3.5"
)
@unittest.skipIf(sys.version_info < (3, 6), reason="Skipping Python 3.5")
class TestBase(unittest.TestCase):
PROJECT = os.environ["GOOGLE_CLOUD_PROJECT"]
INSTANCE_ID = "instance_id"
Expand Down Expand Up @@ -67,10 +65,10 @@ def test_get_connection_params(self):
def test_get_new_connection(self):
db_wrapper = self._make_one(self.settings_dict)
db_wrapper.Database = mock_database = mock.MagicMock()
mock_database.connect = mock_connection = mock.MagicMock()
mock_database.connect = mock_connect = mock.MagicMock()
conn_params = {"test_param": "dummy"}
db_wrapper.get_new_connection(conn_params)
mock_connection.assert_called_once_with(**conn_params)
mock_connect.assert_called_once_with(**conn_params)

def test_init_connection_state(self):
db_wrapper = self._make_one(self.settings_dict)
Expand Down Expand Up @@ -109,10 +107,3 @@ def test_is_usable(self):

mock_connection.cursor = mock.MagicMock(side_effect=Error)
self.assertFalse(db_wrapper.is_usable())

def test__start_transaction_under_autocommit(self):
db_wrapper = self._make_one(self.settings_dict)
db_wrapper.connection = mock_connection = mock.MagicMock()
mock_connection.cursor = mock_cursor = mock.MagicMock()
db_wrapper._start_transaction_under_autocommit()
mock_cursor.assert_called_once_with()
44 changes: 0 additions & 44 deletions tests/unit/django_spanner/test_client.py

This file was deleted.

0 comments on commit bf84e88

Please sign in to comment.