Exclude not critical test (#2)

* Exclude not critical test

* Add exclude-tests option

* Update documentation

* Clean forgotten print

* Improve Readme, with examples
This commit is contained in:
Vladyslav Malynych authored and David Wobrock committed 2019-07-28 12:28:56 +02:00
1 parent e93d4ec4c7
commit 8eede82a38
4 files changed
+59 -4

No files matched your search

+4 -1
View File
@@ -42,6 +42,7 @@ class MigrationLinter(object):
ignore_name=None,
include_apps=None,
exclude_apps=None,
exclude_tests=None,
database=DEFAULT_DB_ALIAS,
cache_path=DEFAULT_CACHE_PATH,
no_cache=False,
@@ -54,6 +55,7 @@ class MigrationLinter(object):
self.ignore_name = ignore_name or tuple()
self.include_apps = include_apps
self.exclude_apps = exclude_apps
self.exclude_tests = exclude_tests
self.database = database or DEFAULT_DB_ALIAS
self.cache_path = cache_path or DEFAULT_CACHE_PATH
self.no_cache = no_cache
@@ -118,7 +120,8 @@ class MigrationLinter(object):
return
sql_statements = self.get_sql(app_label, migration_name)
errors = analyse_sql_statements(sql_statements)
exclude_tests = self.exclude_tests or []
errors = analyse_sql_statements(sql_statements, exclude_tests)
if not errors:
print("OK")