Skip to content

Commit 4ad28f0

Browse files
committed
Fix linter warnings
1 parent cfdb51d commit 4ad28f0

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

cufile/cufile.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
import os
66
import ctypes
7-
from .bindings import *
7+
from .bindings import (
8+
cuFileDriverOpen,
9+
cuFileDriverClose,
10+
cuFileHandleRegister,
11+
cuFileHandleDeregister,
12+
cuFileRead,
13+
cuFileWrite,
14+
)
815

916

1017
def _singleton(cls):

tests/test_cufile.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import os
66
import ctypes
7-
import pytest
87
import time
98
from cuda.bindings import driver as cuda
109
from cufile import CuFile

tests/test_cufile_mock.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
import os
99
import ctypes
1010
import pytest
11-
import sys
12-
from unittest.mock import Mock, MagicMock, patch, call
11+
from unittest.mock import MagicMock, patch
1312

1413
# Mock the library loading before importing the cufile module
1514
mock_libcufile = MagicMock()
@@ -23,7 +22,7 @@
2322

2423
with patch("ctypes.CDLL", return_value=mock_libcufile):
2524
from cufile import CuFile, CuFileDriver
26-
from cufile.bindings import CUfileError, CUfileHandle_t, CUfileDescr, DescrUnion
25+
from cufile.bindings import CUfileError, CUfileHandle_t
2726

2827
# this is needed to avoid exceptions while the singleton driver object is
2928
# GCed at the program exit.
@@ -62,7 +61,6 @@ def reset_singleton():
6261
"""Reset the CuFileDriver singleton between tests."""
6362
# The singleton decorator stores instances in a closure
6463
# We need to access and clear it
65-
import cufile.cufile as cufile_module
6664

6765
# Force garbage collection to clean up any lingering instances
6866
import gc
@@ -80,7 +78,7 @@ class TestCuFileDriver:
8078

8179
def test_driver_initialization(self, mock_libcufile):
8280
"""Test that CuFileDriver calls cuFileDriverOpen on initialization."""
83-
driver = CuFileDriver()
81+
CuFileDriver()
8482
mock_libcufile.cuFileDriverOpen.assert_called_once()
8583

8684
def test_driver_singleton_pattern(self, mock_libcufile):
@@ -244,7 +242,7 @@ def test_context_manager_closes_on_exception(
244242
):
245243
"""Test that context manager closes file even on exception."""
246244
try:
247-
with CuFile("/tmp/test.bin", "r") as cufile:
245+
with CuFile("/tmp/test.bin", "r"):
248246
raise ValueError("Test exception")
249247
except ValueError:
250248
pass

0 commit comments

Comments
 (0)