diff --git a/faker/providers/python/__init__.py b/faker/providers/python/__init__.py
index 7b1bd6f8..eb8a70a6 100644
--- a/faker/providers/python/__init__.py
+++ b/faker/providers/python/__init__.py
@@ -60,7 +60,7 @@ class Provider(BaseProvider):
             if max_value is None:
                 max_value = min_value + self.random_int()
 
-            left_number = self.random_int(min_value, max_value)
+            left_number = self.random_int(min_value, max_value - 1)
         else:
             sign = '+' if positive else self.random_element(('+', '-'))
             left_number = self.random_number(left_digits)

diff --git a/tests/test_factory.py b/tests/test_factory.py
index ddc8f3b0..110728cb 100644
--- a/tests/test_factory.py
+++ b/tests/test_factory.py
@@ -466,6 +466,16 @@ class FactoryTestCase(unittest.TestCase):
         with pytest.raises(ValueError):
             provider.pyfloat(left_digits=0, right_digits=0)
 
+    def test_pyfloat_in_range(self):
+        # tests for https://github.com/joke2k/faker/issues/994
+        factory = Faker()
+
+        factory.seed_instance(5)
+        result = factory.pyfloat(min_value=0, max_value=1)
+
+        assert result >= 0.0
+        assert result <= 1.0
+
     def test_negative_pyfloat(self):
         # tests for https://github.com/joke2k/faker/issues/813
         factory = Faker()

pyfloat producing values above max_value
* Faker version: 2.0.1
* OS: Windows 10

Calling `pyfloat` with the `max_value` set can produce values above `max_value` leading to issues.

### Steps to reproduce

Run my example code below.

### Expected behavior

Given my following example, I would expect to _only_ see numbers in the range `1 <= x <= 2`.

```
for _ in range(25):
    print(faker.pyfloat(min_value=1, max_value=2))
```

### Actual behavior

However, my example will produce values in the range `1 <= x < 3`.  This behavior is very confusing and unexpected.  Output I got from running my above example:

```
1.200055
2.709
2.319785
2.773763416717
1.521
1.9
2.52454
2.91
1.87016
2.35457
1.92215
1.7
2.461453
1.922252943
1.416632
1.448
2.0
1.5
2.31
2.5114
2.18
1.8
2.12503540581
2.0
```

tests/test_factory.py::FactoryTestCase::test_pyfloat_in_range
tests/test_factory.py::FactoryTestCase::test_add_provider_gives_priority_to_newly_added_provider tests/test_factory.py::FactoryTestCase::test_binary tests/test_factory.py::FactoryTestCase::test_cli_seed tests/test_factory.py::FactoryTestCase::test_cli_seed_with_repeat tests/test_factory.py::FactoryTestCase::test_cli_verbosity tests/test_factory.py::FactoryTestCase::test_command tests/test_factory.py::FactoryTestCase::test_command_custom_provider tests/test_factory.py::FactoryTestCase::test_documentor tests/test_factory.py::FactoryTestCase::test_email tests/test_factory.py::FactoryTestCase::test_ext_word_list tests/test_factory.py::FactoryTestCase::test_format_calls_formatter_on_provider tests/test_factory.py::FactoryTestCase::test_format_transfers_arguments_to_formatter tests/test_factory.py::FactoryTestCase::test_get_formatter_returns_callable tests/test_factory.py::FactoryTestCase::test_get_formatter_returns_correct_formatter tests/test_factory.py::FactoryTestCase::test_get_formatter_throws_exception_on_incorrect_formatter tests/test_factory.py::FactoryTestCase::test_instance_seed_chain tests/test_factory.py::FactoryTestCase::test_invalid_locale tests/test_factory.py::FactoryTestCase::test_ipv4 tests/test_factory.py::FactoryTestCase::test_ipv4_network_class tests/test_factory.py::FactoryTestCase::test_ipv4_private tests/test_factory.py::FactoryTestCase::test_ipv4_private_class_a tests/test_factory.py::FactoryTestCase::test_ipv4_private_class_b tests/test_factory.py::FactoryTestCase::test_ipv4_private_class_c tests/test_factory.py::FactoryTestCase::test_ipv4_public tests/test_factory.py::FactoryTestCase::test_ipv4_public_class_a tests/test_factory.py::FactoryTestCase::test_ipv4_public_class_b tests/test_factory.py::FactoryTestCase::test_ipv4_public_class_c tests/test_factory.py::FactoryTestCase::test_ipv6 tests/test_factory.py::FactoryTestCase::test_language_code tests/test_factory.py::FactoryTestCase::test_locale tests/test_factory.py::FactoryTestCase::test_magic_call_calls_format tests/test_factory.py::FactoryTestCase::test_magic_call_calls_format_with_arguments tests/test_factory.py::FactoryTestCase::test_negative_pyfloat tests/test_factory.py::FactoryTestCase::test_nl_BE_ssn_valid tests/test_factory.py::FactoryTestCase::test_no_words tests/test_factory.py::FactoryTestCase::test_no_words_paragraph tests/test_factory.py::FactoryTestCase::test_no_words_sentence tests/test_factory.py::FactoryTestCase::test_parse_returns_same_string_when_it_contains_no_curly_braces tests/test_factory.py::FactoryTestCase::test_parse_returns_string_with_tokens_replaced_by_formatters tests/test_factory.py::FactoryTestCase::test_password tests/test_factory.py::FactoryTestCase::test_prefix_suffix_always_string tests/test_factory.py::FactoryTestCase::test_random_element tests/test_factory.py::FactoryTestCase::test_random_number tests/test_factory.py::FactoryTestCase::test_random_pyfloat tests/test_factory.py::FactoryTestCase::test_random_pystr_characters tests/test_factory.py::FactoryTestCase::test_random_sample_unique tests/test_factory.py::FactoryTestCase::test_slugify tests/test_factory.py::FactoryTestCase::test_some_words tests/test_factory.py::FactoryTestCase::test_texts_chars_count tests/test_factory.py::FactoryTestCase::test_texts_count tests/test_factory.py::FactoryTestCase::test_texts_word_list tests/test_factory.py::FactoryTestCase::test_unique_words tests/test_factory.py::FactoryTestCase::test_us_ssn_valid tests/test_factory.py::FactoryTestCase::test_words_ext_word_list tests/test_factory.py::FactoryTestCase::test_words_ext_word_list_unique tests/test_factory.py::FactoryTestCase::test_words_valueerror