diff --git a/.coveragerc b/.coveragerc index 4014119..367d9f1 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,5 @@ [run] -branch = false +branch = true omit = wakatime/cli.py wakatime/packages/* diff --git a/tests/samples/codefiles/python.py b/tests/samples/codefiles/python.py index 1978ffd..d9a40f8 100644 --- a/tests/samples/codefiles/python.py +++ b/tests/samples/codefiles/python.py @@ -3,7 +3,7 @@ import os, sys -import django +import django.forms.monstertruck from app import * from flask import session import simplejson as json diff --git a/wakatime/dependencies/python.py b/wakatime/dependencies/python.py index 97734df..8711755 100644 --- a/wakatime/dependencies/python.py +++ b/wakatime/dependencies/python.py @@ -49,9 +49,7 @@ class PythonParser(TokenParser): self._process_import(token, content) def _process_operator(self, token, content): - if self.state is not None: - if content == '.': - self.nonpackage = True + pass def _process_punctuation(self, token, content): if content == '(': diff --git a/wakatime/stats.py b/wakatime/stats.py index 935f9b4..af5069f 100644 --- a/wakatime/stats.py +++ b/wakatime/stats.py @@ -234,7 +234,7 @@ def get_file_head(file_name): except: try: with open(file_name, 'r', encoding=sys.getfilesystemencoding()) as fh: - text = fh.read(512000) + text = fh.read(512000) # pragma: nocover except: log.traceback('debug') return text