Skip to content

Commit

Permalink
Fix the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
chmp committed Apr 15, 2024
1 parent 1dff58c commit a1eee61
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ipytest/coverage_plugin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""A plugin to support coverage in IPython notebooks"""
import coverage.plugin
import coverage.python
import coverage.parser

import linecache
import os.path
import re

import coverage.parser
import coverage.plugin
import coverage.python


def coverage_init(reg, options):
reg.add_file_tracer(IPythonPlugin())
Expand All @@ -16,8 +16,10 @@ class IPythonPlugin(coverage.plugin.CoveragePlugin):
ipython_cell_filename_pattern = r"^.*[\\/]ipykernel_\d+[\\/]\d+.py$"

def file_tracer(self, filename):
if self._is_ipython_cell_file(filename):
return IPythonFileTracer(filename)
if not self._is_ipython_cell_file(filename):
return None

return IPythonFileTracer(filename)

def file_reporter(self, filename):
return IPythonFileReporter(filename)
Expand Down

0 comments on commit a1eee61

Please sign in to comment.