From c7d31cb143ed98ff4a3862b45e4a77de4654645d Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefanor@debian.org>
Date: Fri, 30 Dec 2016 19:12:32 +0100
Subject: Fix test failure on kFreeBSD

Explicitly flush the import machinery cache, in case the filesystem
doesn't have enough mtime resolution to notice change.

Forwarded: https://bitbucket.org/cffi/cffi/commits/ff406edc2609535bbbfdb2d19344a0cf04705b45
Patch-Name: kfreebsd-mtime-resolution
---
 testing/cffi1/test_recompiler.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testing/cffi1/test_recompiler.py b/testing/cffi1/test_recompiler.py
index c47c806..9583360 100644
--- a/testing/cffi1/test_recompiler.py
+++ b/testing/cffi1/test_recompiler.py
@@ -1,5 +1,6 @@
 
 import sys, os, py
+import importlib
 from cffi import FFI, VerificationError, FFIError
 from cffi import recompiler
 from testing.udir import udir
@@ -521,6 +522,8 @@ def test_module_name_in_package():
         assert os.path.exists(str(package_dir.join('mymod.c')))
         package_dir.join('__init__.py').write('')
         #
+        getattr(importlib, 'invalidate_caches', object)()
+        #
         sys.path.insert(0, str(udir))
         import test_module_name_in_package.mymod
         assert test_module_name_in_package.mymod.lib.foo(10) == 42
