If you want your library/application to become bigger and easy to package I hardly recommend to separate source code from test code, because test code shouldn't be packaged in binary distributions (egg or wheel).
You can follow this tree structure:
+-- src/
| +-- main.py
| \-- folder_functions/ # <- Python package
| +-- __init__.py
| \-- function_a.py
\-- tests/
\-- folder_functions/
+-- __init__.py
\-- test_function_a.py
Note: according to the PEP8, Python packages and modules names should be in "snake case" (lowercase + underscore).
The src directory could be avoided if you have (and you should) a main package.
As explained in other comments, the setup.py file should stand next to the src and tests folders (root level).
Read the Python Packaging User Guide
edit
The next step is to create a setup.py, for instance:
from setuptools import find_packages
from setuptools import setup
setup(
name='Your-App',
version='0.1.0',
author='Your Name',
author_email='your@email',
url='URL of your project home page',
description="one line description",
long_description='long description ',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Python Software Foundation License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Programming Language :: Python',
'Topic :: Software Development',
],
platforms=["Linux", "Windows", "OS X"],
license="MIT License",
keywords="keywords",
packages=find_packages("src"),
package_dir={'': 'src'},
entry_points={
'console_scripts': [
'cmd_name = main:main',
],
})
Once your project is configured, you can create a virtualenv and install your application inside:
virtualenv your-app
source your-app/bin/activate
pip install -e .
You can run your tests with unitests standard module.
To import your module in your test_function_a.py, just proceed as usual:
from folder_functions import function_a